package com.hazmatt.android.controller;

import android.app.Activity; 
import android.content.Intent; 
import android.os.Bundle; 
import android.os.Handler;

public class SplashActivity extends Activity { 

     private final int SPLASH_DURATION = 500; 

     @Override 
     public void onCreate( Bundle savedInstanceState ) { 
          super.onCreate( savedInstanceState ); 
          setContentView( R.layout.splashscreen ); 
           
          /* 
           * New Handler to start the Controller activity 
           * and close this splash screen after some delay.
           */ 
          new Handler().postDelayed( new Runnable(){ 
               //@Override
               public void run() { 
                    /* Create an intent that will start the Controller activity. */ 
                    Intent mainIntent = new Intent( SplashActivity.this, ControllerActivity.class ); 
                    SplashActivity.this.startActivity( mainIntent ); 
                    SplashActivity.this.finish(); 
               } 
          }, SPLASH_DURATION); 
     } 
}
